/**
 *
 * @param banList urls that accessible
 * @param url url that need scrutiny
 * @returns boolean, false -> block the url
 */
export const urlAccessible = (banList: string[], url: string) => {
  if (url.startsWith("javascript:")) return true;
  return banList.find((val) => new RegExp("^" + val).test(url)) !== undefined;
};
